const url="https://m.douban.com/rexxar/api/v2/subject_collection/movie_showing/items?count=10"
const url2="https://m.douban.com/rexxar/api/v2/subject_collection/tv_hot/items?count=10"
const url3="https://m.douban.com/rexxar/api/v2/subject_collection/tv_variety_show/items?count=10"
Page({
  data:{
    title:''
  },
  input(e){
    console.log(e)
    this.setData({
      title:e.detail.value
    })
  },
  search(e){
    wx.navigateTo({
      url: '../search/search?title='+this.data.title,
    })
  },
    onLoad(){
        let that=this
        wx.request({//电影
          url,
          success(e){
            console.log('电影')
              console.log(e)
              that.setData({
                movielist:e.data.subject_collection_items
              })
          }
        })
        wx.request({//电视剧
          url:url2,
          success(e){
            console.log('电视剧')
              console.log(e)
              that.setData({
                tvlist:e.data.subject_collection_items
              })
          }
        })
        wx.request({//综艺
          url:url3,
          success(e){
            console.log('综艺')
              console.log(e)
              that.setData({
                varietylist:e.data.subject_collection_items
              })
          }
        })
    }
})